package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119675242";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3p3e49hYjRMW2KdJ5eJUsYeW5s9P1NNMgX9mrwrwZZH65XWjC9tseAf6DfgsgCXgE0WhuqYwjT6xySvvxBA8CuXxfYIrO645Tbnsb0A8f+8hQNySXmCsfCcF3fkz6YRfwxpzXLNBTjVFJAXE9UkTod5sRdmj8jyrJQe7+H85hSnsVegb5t7qlZuXJeNmuzBQF2phU5OInPyQkWA67mKHL0sSfMaKSlZbbRqDjX/7EEZU2e/uIJiWm9qPLa0srLla7Fsb+g3jGVuB5OcRYWBFGpPKCOE2ARJLlDRAjeycm/20mRwQyrTGYiRA6VaC9Ks5OjcWr+f4Te7xUOdHbjmfvAgMBAAECggEANHTJ9nObqSE4k6poaretbAreUedyUCRxdVrLUosBrQMOSyXKCX324iBRsP8scE8kD8Q8Xvdghql4KQEP6yxsmSufwaJSo32Wnm/9C9mmqE0DTx4g/ofBMVFZCCd0F0PqUaR5IeCz9Fl18TNPQ+OeuQOIsDkxDYpa/zcs6zrseM8PrFaH7bMukYrzqFePTGiAieXcC7Hlg8GEHmQUZWQXX8clufEFcQkeaYbfEqS0hdmP2Ef+Cn2vUm970fUoMeeCVKK9WLMJnK4Mc1NF+7ECyaOcMt6lv94MOgPGNOIjtqtFd2yIq+o6qMul8DrSy7bAPkRpfHpmNbcQmHt6fKqHYQKBgQDyYBrZJLTTOZuFe/jocKrFhh6XNm68YBuLO9V2WipR2ph+JXWc/s4eKcq+HDIsE2go/OtXLTn1MsXF/3V5KOosrhAGXGAqu2Jf0DhKywPbvaCKfSXeXj1Y2b0snkUPjB37YE/6HUqPmJmPWJ7oRBn+ok+nFUlkY+0nLFJimfrqnwKBgQDB+lY3t3TEJ5JbwiAQsqNhF8AwoqPrB+FrzmZperYIOjkCnUEcX9ENWwxPLiJxPcvgavb5hbfooExn//FcIpKpNTSRL3y6Q7AC/J/PiIBcuLol7lu+DLzQjA6xR5UvwmQBvn94JDKb1OEluDJkTcYZodAIENvOka9YkF+iBO/QsQKBgCd1+ikMTtxs7qMm8fl2DnemRGi+Ff1ZcGKU1UY1m9pDyrwPAT0URx6mEzosgQaoCjdSJkbFOEBxib2Yv9mADdBEbpt6grWyWGvdDK0wrGokT3T8tyOjGD3VBXW0Nu43E9KPdbX0+uSyJZ4vAYAzRkAs0OcVEiPkGQJdtvQSucVlAoGAdNYF7FVRvXxgSWhpy+TtR2P43NJ5jO0YN8kAInRJBDedcxeoyiBkWHkItwCAuliQXkHPNIf4N+OlYdblV6tzTvu/B9vkcoSmlYX39Baxyidx57rkA1rEt5BEoT8Oes/JUMufF4wl93qHiiKiJ4w4z+OI2/LbklZpmRyMnZf/omECgYBreqFvt8T1KGbLchwG4AITmd2nsnhsRXJmPDtDV6aC1GsYPvP4yiUZ/k1T6h58SNJldd7VjVJeklCRHi7vy1Wn5EK2sdKApdpM7oKrLiO3jiK9y84Pp4YUYdgCqL9OWKVRB6I3j/AfZzRp06hMvAdsfqO13hkayvwX89NdIxYvKQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxQBpDTyChvbjLWPboxf4eo4EYHhWiQUgGyeoXF+LpAerVw9xIlxnC8NPBRfUK4tw+SGFjFlNl4e+xe1Eov6tl0LJ/aS4Xw55VdZkbAGsARuyNUnuVMNlYxpMRpD4NBV0RE7Y0NMzY/65vswZUeOW/GOC5+k0o7EvOoAz4LdAYle8h0GlNX8V4JSblKqhOY3gnYT1nTZ7fGX6jK182LKhm762j7t3ouy827xCfEtXAScWXmDO7hfKb2W+lk/+cyI0PaWTFmZSsavU8nVk3QnM0/TRdVPted8G0exzQpdGOCBnZDCEReGaH5WKHK24JSxPaNRWOYt7jdFcR9HQiMVdFQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://d521n91265.wicp.vip/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://d521n91265.wicp.vip/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

